<template>
  <input
    type="checkbox"
    class="input_check"
    :disabled="disabled"
    :checked="checked"
    @change="change"
  />
</template>
<script>
export default {
  data() {
    return {
      // checked: false
    };
  },
  model: {
    prop: "checked",
    event: "change",
  },
  methods: {
    change(e) {
      console.log(12);
      this.$emit("change", e.target.checked);
    },
  },
  props: {
    checked: {
      type: Boolean,
      default: false,
    },
    disabled: {
      type: Boolean,
      default: false,
    },
  },
};
</script>
<style lang="scss" scoped>
input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  -webkit-appearance: none;
  background-color: transparent;
  border: 0;
  outline: 0 !important;
  color: #d8d8d8;
  position: relative;
}
input[type="checkbox"]:before {
  content: "";
  display: block;
  width: 1.4rem;
  height: 1.4rem;
  border: 1px solid #ddd;
  background-color: #fff;
  box-sizing: border-box;
  border-radius: 0.9rem;
  margin-top: -4px;
  margin-left: -2px;

  position: absolute;
}

input[type="checkbox"]:disabled:before {
  content: "";
  display: block;
  width: 1.4rem;

  height: 1.4rem;
  border: 1px solid #ddd;
  background-color: #fff;
  box-sizing: border-box;
  border-radius: 0.9rem;
  margin-left: -2px;

  position: absolute;
  margin-top: -4px;
}
input[type="checkbox"]:checked:before {
  content: "";
  display: block;
  width: 1.4rem;
  margin-left: -2px;
  height: 1.4rem;
  border: 1px solid #e46e0e;
  background-color: #e46e0e;
  box-sizing: border-box;
  border-radius: 0.9rem;
  position: absolute;
  margin-top: -4px;
}
input[type="checkbox"]:checked:after {
  content: "";
  display: block;
  width: 0.45rem;
  height: 0.8rem;
  border-left: 0.16rem solid #fff;
  border-top: 0.16rem solid #fff;
  border-radius: 0.06rem;
  box-sizing: border-box;
  position: absolute;
  transform: rotate(-135deg) translate(-70%, 25%);
}
</style>
